package com.example.intelligentattendancesystem.pojo;

import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * @author
 * @version 1.0
 * @className User
 * @since 1.0
 */
@Component
public class User {
    private Integer id;
    private String nick;
    private String icon;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return userId == user.userId && Objects.equals(id, user.id) && nick.equals(user.nick) && icon.equals(user.icon) && password.equals(user.password) && property.equals(user.property);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, nick, icon, userId, password, property);
    }

    private int userId;
    private String password;
    private String property;

    public User(Integer id, String nick, String icon, int userId, String password, String property) {
        this.id = id;
        this.nick = nick;
        this.icon = icon;
        this.userId = userId;
        this.password = password;
        this.property = property;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", nick='" + nick + '\'' +
                ", icon='" + icon + '\'' +
                ", userId=" + userId +
                ", password='" + password + '\'' +
                ", property='" + property + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public User() {
    }
}
